#ifndef _Ape__EventModel_CallbackNoArgs
#define _Ape__EventModel_CallbackNoArgs

#include <Ape/Object.h>
#include <Ape/EventModel/Callback.h>

namespace Ape {
	namespace EventModel {
		class CallbackNoArgs_Base : public Callback {
			TYPE_NAME ("Ape::EventModel::CallbackNoArgs_Base")
		public:
			CallbackNoArgs_Base (Object* object);
			virtual void operator () () const = 0;
		};
		
		template<class Callee_t>
		class CallbackNoArgs : public Ape::EventModel::CallbackNoArgs_Base {
			TYPE_NAME ("Ape::EventModel::CallbackNoArgs<Callee_t>")
		private:
			typedef void (Callee_t::*Method_t) () const;
			mutable Callee_t* m_Object;
			Method_t m_Method;
			
		public:
			CallbackNoArgs (Callee_t* object, Method_t method)
					: CallbackNoArgs_Base (object),
					m_Object (object),
					m_Method (method)
			{}
			
			virtual ~CallbackNoArgs() {}
			
			virtual void operator () () const {
				(m_Object->*m_Method) ();
			}
		};
	}
}

#endif // _Ape__EventModel_CallbackNoArgs
